package com.guangyunl.logic;

public class Demo02Logic {
    public static void main(String[] args) {
        System.out.println("==================");

        int a = 10;
        int b = 20;
        boolean result01 = (++a > 100) & (++b > 10);
        System.out.println("result01 = " + result01); // result01 = false
        System.out.println("a = " + a); // a = 11
        System.out.println("b = " + b); // b = 21
        System.out.println("==================");
        int c = 10;
        int d = 20;
        boolean result02 = (++c > 100) && (++d > 10); //前面的为假，后面的 (++d > 10) 不再执行
        System.out.println("result01 = " + result02); // result02 = false
        System.out.println("c = " + c); // c = 11
        System.out.println("d = " + d); // d = 20
        System.out.println("==================");

        int a1 = 10;
        int b1 = 20;
        boolean result03 = (++a1 < 100) | (++b1 > 10);
        System.out.println("result03 = " + result03); // result03 = true
        System.out.println("a1 = " + a1); // a1 = 11
        System.out.println("b1 = " + b1); // b1 = 21
        System.out.println("==================");

        int c1 = 10;
        int d1 = 20;
        boolean result04 = (++c1 < 100) || (++d1 > 10); //前面的为真，后面的 (++d1 > 10) 不再执行
        System.out.println("result04 = " + result04); // result04 = true
        System.out.println("c1 = " + c1); // c1 = 11
        System.out.println("d1 = " + d1); // d1 = 20
        System.out.println("==================");

    }
}
